Please enable JavaScript to view this website.

Skip to main content

Available Task Resources

CANopen

CANopen:Command

This resource will send a CANopen message over the Inno-Maker USB2CAN adapter.

Input Parameters

  • Type: The value can be "Download" or "Upload"
  • NodeId: The value can be a hex number as string or the equivalent in decimal
  • Index: The value can be a hex number as string or the equivalent in decimal
  • SubIndex: (optional) The value can be a hex number as string or the equivalent in decimal
  • Payload: (optional) The value can be a hex number as string
{
"Type": "Download" | "Upload",
"NodeId": string | number,
"Index": string | number,
"SubIndex": string | number | undefined,
"Payload": string | undefined
}

Result

{
"Result": number[]
}

Example State Definition

"Send password to HMI": {
"Type": "Task",
"Resource": "CANopen:Command",
"Parameters": {
"Type": "Download",
"NodeId": 8,
"Index": "2101",
"SubIndex": "1",
"Payload": "1234123412341234"
},
"ResultSelector": {
"Send.$": "$.Result"
},
"End": true
}

CANOpen:OLRouter

This resource will send a CANOpen message over the Inno-Maker USB2CAN adapter targeting the OL Router in the HMI sub-system for sending OpenLink commands.

Input Parameters

  • MessageType: Defines what operation the command is trying to request.
  • IsWrite: Defines if the command is a write or read command.
  • RouteType: Defines if the command is being sent to a Tool or BLE Module.
  • CommandBody: Hexadecimal representation of the command payload.
{
"MessageType": string,
"IsWrite": boolean,
"RouteType": "Tool" | "BLE",
"CommandBody": string,
}

Result

{
"OpenLinkCommandResponse": {
"FullRawResponse": number[],
"MessageType": string,
"Payload": number[]
}
}

Example State Definition

"Read BOD of the HMI": {
"Type": "Task",
"Resource": "CANopen:OLRouter",
"Parameters": {
"MessageType": "01",
"IsWrite": false,
"RouteType": "Tool",
"CommandBody": "001104"
},
"End": true
}

File

File:Write

This resource is used to save the contents to a file, the user will get prompted to choose a destination for the file. If the filename remains the same the app will override the file every time the script is executed.

Input Parameters

  • IsBinary: (optional) Set to true when the output file is binary — either when Content is already binary data, or when Encoding is "base64" (since the decoded result is binary bytes)
  • HidePrompt: (optional) If true will save the file directly without a prompt to the user
  • Encoding: (optional) Set to "base64" when Content is a base64-encoded string that should be decoded to binary bytes before writing. Use this when binary data is passed through script state (for example, from a Network:ApiCall result stored via ResultPath), since Blob and ArrayBuffer values cannot be preserved when stored in state.
  • Filename: The name of the file to be saved
  • Content: The content to be saved to the file. When Encoding is "base64", this must be a base64 string.
{
"IsBinary": boolean | undefined,
"HidePrompt": boolean | undefined,
"Encoding": "base64" | undefined,
"Filename": string,
"Content": string | object,
}

Example State Definition

"Write To File": {
"Type": "Task",
"Resource": "File:Write",
"Parameters": {
"Filename": "CurrentContext.txt",
"Content": "Hello World"
},
"End": true
}

Advanced Example State Definition

"Write To File": {
"Type": "Task",
"Resource": "File:Write",
"Parameters": {
"IsBinary": true,
"HidePrompt": true,
"Filename": "CurrentContext.txt",
"Content.$": "$"
},
"End": true
}

Base64 Binary Example State Definition

Use Encoding: "base64" when writing binary files (such as PDFs) whose content was returned from an API call and stored in script state. Set ResponseType to "text" on the API call so the response is stored as a base64 string.

"GeneratePDFReportAPICall": {
"Type": "Task",
"Resource": "Network:ApiCall",
"Parameters": {
"BaseUrl": "ToolDataAPI",
"Method": "POST",
"ResponseType": "text",
"Path": "/tooldata/v1/tooldata/service-instance/report",
"Body": {
"reportType": 4,
"tool": {
"serialNumber.$": "$.ToolRecord.serialNumber",
"description.$": "$.ToolRecord.description",
"modelNumber.$": "$.ToolRecord.model"
},
"report": {
"laserCalibration": {
"excludeVerticalAccuracySpecs": true,
"calibrationDate.$": "$.ExecutionStartTime"
}
},
"service": {
"technicianName.$": "$.UserEmail"
},
"mpbid.$": "$.ToolRecord.mpbid",
"svCode.$": "$.Service.SVCode"
}
},
"ResultPath": "$.MyPDFData",
"Next": "Write To File"
},
"Write To File": {
"Type": "Task",
"Resource": "File:Write",
"Parameters": {
"IsBinary": true,
"Encoding": "base64",
"Filename.$": "States.Format('LaserCalibration_{}.pdf', $.ToolRecord.serialNumber)",
"Content.$": "$.MyPDFData"
},
"End": true
}

File:Read

This resource is used to prompt the use to choose a file to be read and be loaded into the script context.

Input Parameters

  • None

Result

{
"Result": string | object
}

Product

Product:Connect

Input Parameters

  • CommunicationMethod - The physical device or method that will be used to connect to a product
  • Target - What device type you would like to talk to (i.e., M18 tool, MX battery, M18 charger, etc)
  • MACAddress - (mostly optional) required if BLED112 or M18CA-Dongle-Mode specified and is the MAC address of the target device
{
"CommunicationMethod": "CommunicationAdapter" | "BLED112" | "M18CA-Dongle-Mode" | "BleuIO" | "USB2CAN" | "FTDI",
"Target": "Adapter" | "M18Tool" | "M18Charger" | "M18Battery" | "MXTool" | "MXBattery" | "MXCharger" | "M12Tool",
"MACAddress": string | undefined
}

Result

{
"Result": "Success" | "Timeout"
}

Example State Definition

"Connect State": {
"Type": "Task",
"Resource": "Product:Connect",
"Parameters": {
"CommunicationMethod": "2700"
},
"End": true
}

Product:Disconnect

This resource will disconnect from the last active established connection.

Input Parameters

  • None

Result

{}

Example State Definition

"Disconnect State": {
"Type": "Task",
"Resource": "Product:Disconnect",
"End": true
}

Product:ConnectionDetails

This resource will return the connection details of the current active established connection.

Input Parameters

  • None

Result

{
"IsConnected": boolean,
"ConnectionType": "BLE" | "Wired" | "CAN" | undefined
}

Example State Definition

"Get Connection Details": {
"Type": "Task",
"Resource": "Product:ConnectionDetails",
"ResultSelector": {
"IsConnected.$": "$.IsConnected",
"ConnectionType.$": "$.ConnectionType"
},
"Next": "XYZ"
}

OpenLink:SendCommand

Note: When sending OpenLinkCommands, the interpreter will calculate and append the sequenceId, length, and checksum bytes.

Input Parameters

  • MessageType: Defines what operation the command is trying to request.
  • IsWrite: Defines if the command is a write or read command.
  • RouteType: Defines if the command is being sent to a Tool or BLE Module.
  • CommandBody: Hexadecimal representation of the command payload.
  • ExampleTaskResult: (optional) The JSON representation of what the response from the command should be.Can be used to mock the response of the command. The object should include the IsSuccess field to indicate if the command was successful.
  • IsPayloadSecret: (optional) should be set to True, if the sent command includes sensitive information like Tool passwords, claim Keys, or certificates.
  • LogDescription: (optional) A description of what the command is trying to do.
  • ExpectedResponsePayload: (optional) Hexadecimal representation of the expected response payload. Throws an error if the actual response payload does not exactly match ExpectedResponsePayload.
{
"MessageType": string,
"IsWrite": boolean,
"RouteType": "Tool" | "BLE",
"CommandBody": string,
"ExampleTaskResult": "ExampleTaskResult" | undefined,
"IsPayloadSecret": boolean | undefined,
"LogDescription": string | undefined,
"ExpectedResponsePayload": string | undefined
}

Result

{
"OpenLinkCommandResponse": {
"FullRawResponse": number[],
"MessageType": string,
"Payload": number[]
}
}

Example State Definition

"Blink": {
"Type": "Task",
"Resource": "OpenLink:SendCommand",
"Parameters": {
"MessageType": "01",
"IsWrite": true,
"RouteType": "Tool",
"CommandBody": "A02301",
"ExampleTaskResult": {
"IsSuccess": true,
"ResultObject": {
"Message": "Successfully performed the action"
}
},
"IsPayloadSecret": true,
"LogDescription": "Accessing the Local Memory"
},
"End": true
}

OpenLink:WriteAndVerify

This resource is used mostly for manufacturing scripts that require a write followed by a read to verify that the data was successfully written on the tool.

  • Address: The Hexadecimal memory address where the data is to be written.
  • Payload: The Hexadecimal representation of the data to be written.
  • RouteType: Defines if the command is being sent to a Tool or BLEModule.
  • MessageType: (optional) Defines what operation the command is trying to request.
  • ExampleTaskResult: (optional) The JSON representation of what the response from the command should be.Can be used to mock the response of the command. The object should include the IsSuccess field to indicate if the command was successful.

Input Parameters

{
"Address": string,
"Payload": string,
"RouteType": "Tool" | "BLE",
"MessageType": "01" | "05" | undefined,
"ExampleTaskResult": string | undefined
}

Result

{
"Result": boolean
}

Example State Definition

"Write And Verify": {
"Type": "Task",
"Resource": "OpenLink:WriteAndVerify",
"Parameters": {
"Address": "0004",
"Payload": "0010000001",
"RouteType": "Tool",
"MessageType": "01"
},
"End": true
}

OpenLink:SendCommandViaMailbox (Deprecated) Use OpenLink:SendCommandToBLE instead

This is very similar to the OpenLink:SendCommand Resource.

The main difference is that this resource also includes a MailboxType parameter.

The MailboxType parameter instructs the interpreter to use a particular "version" of the mailbox mechanism (which varies by platform and/or product).

Note: All the parameters on this resource refer to the inner packet. That is to say, the packet that is being put in the mailbox and forwarded to the BLE module.

Input Parameters

  • MailboxType: Defines what version of the mailbox mechanism to use.
  • MessageType: Defines what operation the command is trying to request.
  • IsWrite: Defines if the command is a write or read command.
  • RouteType: Defines if the command is being sent to a Tool or BLEModule.
  • CommandBody: Hexadecimal representation of the command payload.
  • ExampleTaskResult: (optional) The JSON representation of what the response from the command should be.Can be used to mock the response of the command. The object should include the IsSuccess field to indicate if the command was successful.
  • IsPayloadSecret: (optional) should be set to True, if the sent command includes sensitive information like Tool passwords, claim Keys, or certificates.
  • LogDescription: A description of what the command is trying to do.
{
"MailboxType": "M18ClassicNew",
"MessageType": string,
"IsWrite": boolean,
"RouteType": "Tool" | "BLE",
"CommandBody": string,
"ExampleTaskResult": string | undefined,
"IsPayloadSecret": boolean | undefined,
"LogDescription": string | undefined
}

Result

{
"OpenLinkCommandResponse": {
"FullRawResponse": number[],
"MessageType": string,
"Payload": number[]
}
}

Example State Definition

"Send Default BLE Module Password": {
"Type": "Task",
"Resource": "OpenLink:SendCommand",
"Parameters": {
"MailboxType": "M18ClassicNew",
"MessageType": "01",
"IsWrite": true,
"RouteType": "BLE",
"CommandBody": "003B3333333333333333",
"IsPayloadSecret": true,
"LogDescription": "Writing the default BLE Module password"
},
"End": true
}

OpenLink:WriteAndVerifyViaMailbox

This is very similar to the OpenLink:WriteAndVerify Resource.

The main difference is that this resource also includes a MailboxType parameter.

The MailboxType parameter instructs the interpreter to use a particular "version" of the mailbox mechanism (which varies by platform and/or product).

This resource is used mostly for manufacturing scripts that require a write followed by a read to verify that the data was successfully written to the BLE Module by way of a communication adapter.

Input Parameters

  • MailboxType: Defines what version of the mailbox mechanism to use.
  • Address: The Hexadecimal memory address where the data is to be written.
  • Payload: The Hexadecimal representation of the data to be written.
  • RouteType: Defines if the command is being sent to a Tool or BLEModule.
  • MessageType: (optional) Defines what operation the command is trying to request.
  • ExampleTaskResult: (optional) The JSON representation of what the response from the command should be.Can be used to mock the response of the command. The object should include the IsSuccess field to indicate if the command was successful.
{
"MailboxType": "M18ClassicNew" | "MX" | additional options in future,
"Address": string,
"Payload": string,
"RouteType": "Tool" | "BLE",
"MessageType": "01" | "05" | undefined,
"ExampleTaskResult": "ExampleTaskResult" | undefined,
}

Result

{
"Result": boolean
}

Example State Definition

"Write And Verify Via Mailbox": {
"Type": "Task",
"Resource": "OpenLink:WriteAndVerifyViaMailbox",
"Parameters": {
"MailboxType": "M18ClassicNew",
"Address": "0004",
"Payload": "0010000001",
"RouteType": "Tool"
},
"End": true
}

OpenLink:SendCommandToTool

Resource dedicated to sending OpenLink commands to the Tool MCU. The SID will be set automatically to handle the proper routing bit.

Note: When sending OpenLinkCommands, the interpreter will calculate and append the sequenceId, length, and checksum bytes.

Input Parameters

  • MessageType: Defines what operation the command is trying to request.
  • IsWrite: Defines if the command is a write or read command.
  • Payload: Hexadecimal representation of the command payload.
  • ExampleTaskResult: (optional) The JSON representation of what the response from the command should be.Can be used to mock the response of the command. The object should include the IsSuccess field to indicate if the command was successful.
  • IsPayloadSecret: (optional) should be set to True, if the sent command includes sensitive information like Tool passwords, claim Keys, or certificates.
  • LogDescription: (optional) A description of what the command is trying to do.
  • ExpectedResponsePayload: (optional) Hexadecimal representation of the expected response payload. Throws an error if the actual response payload does not exactly match ExpectedResponsePayload.
{
"MessageType": string,
"IsWrite": boolean,
"Payload": string,
"ExampleTaskResult": "ExampleTaskResult" | undefined,
"IsPayloadSecret": boolean | undefined,
"LogDescription": string | undefined,
"ExpectedResponsePayload": string | undefined
}

Result

{
"OpenLinkCommandResponse": {
"FullRawResponse": number[],
"MessageType": string,
"Payload": number[]
}
}

Example State Definition

"Blink": {
"Type": "Task",
"Resource": "OpenLink:SendCommandToTool",
"Parameters": {
"MessageType": "01",
"IsWrite": true,
"Payload": "A02301",
"ExampleTaskResult": {
"IsSuccess": true,
"ResultObject": {
"Message": "Successfully performed the action"
}
},
"IsPayloadSecret": true,
"LogDescription": "Accessing the Local Memory"
},
"End": true
}

OpenLink:SendCommandToBLE

Resource dedicated to sending OpenLink commands to the BLE Module. The SID will be set automatically to handle the proper routing bit. If connected via a wired connection, the command will be sent to the BLE Module by way of the appropriate "mailbox" forwarding mechanism.

Note: When sending OpenLinkCommands, the interpreter will calculate and append the sequenceId, length, and checksum bytes.

Input Parameters

  • MessageType: Defines what operation the command is trying to request.
  • IsWrite: Defines if the command is a write or read command.
  • Payload: Hexadecimal representation of the command payload.
  • ExampleTaskResult: (optional) The JSON representation of what the response from the command should be. Use to Mock the response of the command.
  • IsPayloadSecret: (optional) should be set to True, if the sent command includes sensitive information like Tool passwords, claim Keys, or certificates.
  • LogDescription: (optional) A description of what the command is trying to do.
  • ExpectedResponsePayload: (optional) Hexadecimal representation of the expected response payload. Throws an error if the actual response payload does not exactly match ExpectedResponsePayload.
{
"MessageType": string,
"IsWrite": boolean,
"Payload": string,
"ExampleTaskResult": "ExampleTaskResult" | undefined,
"IsPayloadSecret": boolean | undefined,
"LogDescription": string | undefined,
"ExpectedResponsePayload": string | undefined
}

Result

{
"OpenLinkCommandResponse": {
"FullRawResponse": number[],
"MessageType": string,
"Payload": number[]
}
}

Example State Definition

"Blink": {
"Type": "Task",
"Resource": "OpenLink:SendCommandToBLE",
"Parameters": {
"MessageType": "01",
"IsWrite": true,
"Payload": "A02301",
"ExampleTaskResult": {
"IsSuccess": true,
"ResultObject": {
"Message": "Successfully performed the action"
}
},
"IsPayloadSecret": true,
"LogDescription": "Accessing the Local Memory"
},
"End": true
}

OpenLink:CANopenRouter

This resource will send a CANopen message via OpenLink. Use this instead of CanOpen:Command when connected to a CANopen device via BLE.

Input Parameters

  • Type: The value can be "Download" or "Upload"
  • NodeId: The value can be a hex number as string or the equivalent in decimal
  • Index: The value can be a hex number as string or the equivalent in decimal
  • SubIndex: (optional) The value can be a hex number as string or the equivalent in decimal
  • Payload: (optional) The value can be a hex number as string. Required if Type is "Download"
  • UploadLength: (optional) The value can be a hex number as string. Required if Type is "Upload"
{
"Type": "Download" | "Upload",
"NodeId": string | number,
"Index": string | number,
"SubIndex": string | number | undefined,
"Payload": string | undefined,
"UploadLength": string | number | undefined
}

Result

{
"Result": number[]
}

Example State Definition

Download Example:

"Send Service Password Over BLE": {
"Type": "Task",
"Resource": "OpenLink:CANopenRouter",
"Parameters": {
"Type": "Download",
"NodeId": "1",
"Index": "2101",
"SubIndex": "01",
"Payload.$": "$.ToolRecord.servicePassword"
},
"Catch": [
{
"ErrorEquals": [
"States.ALL"
],
"Next": "Display Service Password Error"
}
],
"ResultSelector": {
"Auth.$": "$.Result"
},
"Next": "Read Limit Bitfield over BLE"
}

Upload Example:

"Read BMSF Bitfield over BLE": {
"Type": "Task",
"Resource": "OpenLink:CANopenRouter",
"Parameters": {
"Type": "Upload",
"NodeId": "1",
"Index": "2301",
"SubIndex": "5",
"UploadLength": 4
},
"Catch": [
{
"ErrorEquals": [
"States.ALL"
],
"Next": "Display Error"
}
],
"ResultSelector": {
"BMSFaultBitfield.$": "States.ByteArrayToNumber($.Result, true)"
},
"Next": "Parse Fault Codes"
}

Print

LabelPrintConfig

This object defines the printer's current configuration settings.

Definition

"LabelPrintConfig": {
"printerName": string,
"productReference": string,
"textXPosition": number,
"textYPosition": number,
"qrXPosition": number,
"qrYPosition": number,
"printWidthInDots"?: number,
"printSpeedInInchesPerSecond"?: PrintSpeed,
"mediaType"?: MediaType,
"orientation"?: Orientation,
"fieldOrientation"?: FieldOrientation,
"textHeight"?: number,
"textWidth"?: number,
"font"?: string,
"darkness"?: number,
"includeSerialNumberQR"?: boolean,
"qrMagnificationFactor"?: string,
"qrContent"?: QRContent
}

Print:QRCode

This resource is used for print QRCodes during the manufacturing process, the resource expects that the line is configured for the printer.

Input Parameters

  • ModelNumber: The model number to be printed on the QRCode label.
  • SerialNumber: The serial number to be printed on the QRCode label.
  • PrintConfig: When running a manufacturing script, a CurrentActiveConfig object is provided from the configuration setup by the Manufacturing Engineer, this CurrentActiveConfig object has the qrCodeLabelConfig attribute, that is of type LabelPrintConfig (defined above) and defines the printer's current configuration settings.
  • ShouldPrintQRCode: (optional) If set to true, the QRCode will be printed on the label.
  • InternalModelNumber: (optional) The internal model number to be printed on the QRCode label.
  • ConfigurationId: (optional) The configuration id of the line configuration used to be print the QRCode label.
{
"ModelNumber": string,
"SerialNumber": string,
"PrintConfig": LabelPrintConfig | undefined,
"ShouldPrintQRCode"?: boolean,
"InternalModelNumber"?: string,
"ConfigurationId"?: string
}

Result

{
"Result": "Success" | "Failed"
}

Example State Definition

"Write And Verify": {
"Type": "Task",
"Resource": "Print:QRCode",
"Parameters": {
"ModelNumber": "2020-20",
"SerialNumber": "G1234-12345",
"PrintConfig": "$.CurrentActiveConfig.qrCodeLabelConfig",
"ShouldPrintQRCode": true,
"InternalModelNumber": "2020-20",
"ConfigurationId": "6b9b9c7a-0fa4-4801-9701-92d3e241402b"
},
"End": true
}

Print:Nameplate

This resource is used for printing Nameplates during the manufacturing process, the resource expects that the line is configured for the printer.

Input Parameters

  • SerialNumber: The serial number to be printed on the Nameplate label.
  • PrintConfig: When running a manufacturing script, a CurrentActiveConfig object is provided from the configuration setup by the Manufacturing Engineer, this CurrentActiveConfig object has the nameplateLabelConfig attribute, that is of type LabelPrintConfig (defined above) and defines the printer's current configuration settings.
  • ShouldPrintNameplate: (optional) If set to true, the Nameplate will be printed on the label.
  • ConfigurationId: (optional) The configuration id of the line configuration used to be print the Nameplate label.
{
"SerialNumber": string,
"PrintConfig": LabelPrintConfig | undefined,
"ShouldPrintNameplate"?: boolean,
"ConfigurationId"?: string
}

Result

{
"Result": "Success" | "Failed"
}

Example State Definition

"Write And Verify": {
"Type": "Task",
"Resource": "Print:Nameplate",
"Parameters": {
"SerialNumber": "G1234-12345",
"PrintConfig": "$.CurrentActiveConfig.nameplateLabelConfig",
"ShouldPrintNameplate": true,
"ConfigurationId": "6b9b9c7a-0fa4-4801-9701-92d77741402b"
},
"End": true
}

Network

Network:ApiCall

This resource is used for making API calls to the Milwaukee Tool endpoints.

Input Parameters

  • BaseUrl: The base url of the endpoint to be called.
  • Path: The path of the endpoint to be called.
  • Method: The HTTP method to be used.
  • Body: (optional) The body of the request.
  • ResponseType: (optional) Controls how the response body is deserialized. Defaults to "json" (response is parsed as a JSON object). Set to "text" when the endpoint returns raw or base64-encoded binary content that must be preserved as a string in state (for example, before passing to File:Write with Encoding: "base64").
OneKey = 'https://onekeyapi.milwaukeetool.com',
OneKeyAPIGateway = 'https://onekeyapigw.milwaukeetool.com/prod',
ToolDataAPI = 'https://tooldata-api.milwaukeetool.com',
ManufacturingAPI = 'https://manufacturing-api.milwaukeetool.com',
QuickLinkAPI = 'https://quicklink-api.milwaukeetool.com'
TulipAPI = 'https://milwaukee-tool.tulip.co/'
{
"BaseUrl": "OneKey" | "OneKeyAPIGateway" | "ToolDataAPI" | "ManufacturingAPI" | "QuickLinkAPI" | "TulipAPI",
"Path": string,
"Method": "GET" | "POST" | "PUT" | "DELETE",
"Body": object | undefined,
"ResponseType": "json" | "text" | "blob" | undefined
}

Result

{
... // HTTP Response body (object when ResponseType is "json"; string when ResponseType is "text")
}

Example State Definition

"My Milwaukee Tool Endpoint API Call State": {
"Type": "Task",
"Resource": "Network:ApiCall",
"Parameters": {
"BaseUrl": "ToolDataAPI",
"Path": "/productInfos",
"Method": "GET"
}
}

Report

Report:Generate

This resource generates a service or calibration report PDF via the ToolData API and prompts the user to save the file. Tool, service, and customer metadata can be supplied explicitly or will fall back to the connected tool record and current user when omitted.

Input Parameters

  • ReportType: The type of report to generate. See ReportType values below.
  • ReportDetails: Report-type-specific details. Shape depends on ReportType. See ReportDetails by ReportType below.
  • Tool: (optional) Partial tool metadata. Falls back to the connected tool record when omitted. For ChainHoist reports, modelNumber falls back to the region-specific model (modelEMEA or modelANZ) when not provided.
  • Service: (optional) Partial service metadata. Falls back to the current user for technicianName when omitted.
  • ServiceDetails: (optional, deprecated) Alias for Service.
  • Customer: (optional) Partial customer metadata.
  • SvCode: (optional) Service visit code. Falls back to the connected tool record when omitted.
  • Mpbid: (optional) MPBID. Falls back to the connected tool record when omitted. Required if not available from the connected tool.
  • UserId: (optional) User ID. Falls back to the current user when omitted.
  • Language: (optional) Report language code.
  • Filename: (optional) Download filename. Defaults to {ReportType}-{timestamp}.pdf.
{
"ReportType": "Hydraulic" | "DTW" | "ImpactWrench" | "LaserCalibration" | "ChainHoist" | "DTWCertification" | "BenderCalibration" | "SanderCalibration" | "ElectroFusionCalibration" | "CTWCertification",
"ReportDetails": object,
"Tool": {
"description": string | undefined,
"modelNumber": string | undefined,
"serialNumber": string | undefined
} | undefined,
"Service": {
"technicianName": string | undefined,
"phone": string | undefined,
"fax": string | undefined,
"comments": string | undefined,
"companyName": string | undefined,
"companyLogo": string | undefined,
"address": {
"line1": string,
"city": string,
"state": string,
"zipCode": string
} | undefined
} | undefined,
"Customer": {
"name": string | undefined,
"phone": string | undefined,
"email": string | undefined,
"address": {
"line1": string,
"city": string,
"state": string,
"zipCode": string
} | undefined
} | undefined,
"SvCode": string | undefined,
"Mpbid": string | undefined,
"UserId": string | undefined,
"Language": string | undefined,
"Filename": string | undefined
}

ReportType values

ReportTypeDescription
HydraulicHydraulic tool status report
DTWDigital torque wrench calibration/certification status
ImpactWrenchImpact wrench calibration report
LaserCalibrationLaser calibration report
ChainHoistM18 chain hoist inspection report
DTWCertificationDigital torque wrench certification report
BenderCalibrationBender calibration report
SanderCalibrationSander calibration report
ElectroFusionCalibrationElectro-fusion calibration report
CTWCertificationCompact torque wrench certification report

ReportDetails by ReportType

The ReportDetails object must match the shape for the selected ReportType.

Hydraulic
{
"status": boolean
}
DTW
{
"calibrationStatus": boolean,
"calibrationDate": string,
"certificationStatus": boolean,
"certificationDate": string
}
ImpactWrench
{
"units": "ft-lbs" | "Nm",
"targetTorque": number,
"torqueWrenchId": string,
"torqueWrenchSerial": string,
"location": string,
"batteryModel": string,
"certifiedBy": string,
"trainingData": {
"[id]": number
},
"calibrationData": {
"[id]": number
},
"calibrationStatus": boolean,
"calibrationDate": string,
"calibrationDataMean": string,
"calibrationDataStdDev": string,
"calibrationDataRepeatability": string
}
LaserCalibration
{
"calibrationStatus": boolean | undefined,
"calibrationDate": string,
"excludeVerticalAccuracySpecs": boolean | undefined
}
ChainHoist

Free-form object. Common fields used by the chain hoist report template:

{
"loadTestResult": string,
"clutchAdjustmentResult": string,
"qa1": string,
"qb1": string,
"qc1": string,
"qd1": string,
"qe1": string,
"qf1": string,
"qg1": string,
"qh1": string,
"qa2": string,
"qb2": string,
"qc2": string,
"qd2": string,
"qe2": string,
"qf2": string,
"qg2": string,
"qh2": string,
"qi2": string,
"qj2": string,
"qk2": string,
"ql2": string,
"technicianEmployeeID": string,
"calibrationDate": string
}

Pass/fail checklist values are typically "PASS", "FAIL", or "N/A".

DTWCertification
{
"calibrationEquipment": string,
"equipmentAccuracy": number,
"units": "ft•lbf" | "N•m",
"torqueRange": string,
"batteryModel": string,
"temperature": number,
"temperatureUnits": "F" | "C",
"location": string,
"stationNumber": string,
"operator": string,
"transducerSerialNumber": string,
"procedure": string,
"clockwiseTorqueTolerance": number,
"counterclockwiseTorqueTolerance": number,
"clockwiseTorque": {
"[torque]": number[]
},
"counterclockwiseTorque": {
"[torque]": number[]
}
}

Torque map keys are numeric torque setpoints (for example, "50", "100"). Values are arrays of measured readings at that setpoint.

BenderCalibration
{
"calibrationStatus": boolean,
"calibrationOffset": string,
"calibrationDate": string,
"location": string,
"certifiedBy": string
}
SanderCalibration
{
"calibrationStatus": boolean,
"calibrationDate": string,
"hallADCMaxValue": number,
"hallADCMinValue": number
}
ElectroFusionCalibration
{
"firmwareVersion": {
"hmi": string,
"orca": string,
"inverter": string,
"tool": string
},
"date": string,
"location": string,
"region": string,
"footer": {
"phone": string,
"website": string,
"address": string
},
"calibrationDate": string,
"toolTest": {
"armingSwitch": { "pass": boolean },
"scannerFunctionality": { "pass": boolean },
"dataExport": { "pass": boolean },
"gps": { "pass": boolean }
},
"functionalTest": {
"loadResistance": { "pass": boolean, "value": number, "tolerance": number | undefined },
"fusionVoltage40v": { "pass": boolean, "value": number, "tolerance": number | undefined },
"fusionVoltage16v": { "pass": boolean, "value": number, "tolerance": number | undefined },
"ambientTemperature": { "pass": boolean, "value": number, "tolerance": number | undefined }
},
"regionCertType": "ANZ" | "EMEA" | "NA" | null | undefined,
"calibrationUnitCalibrationDate": string | undefined,
"calibrationNumber": string | undefined
}
CTWCertification

Same structure as DTWCertification, with additional optional fields and torque readings that include as-found and as-left values:

{
"serviceType": "calibration" | "repair" | undefined,
"calibrationEquipment": string,
"equipmentAccuracy": number,
"units": "ft•lbf" | "N•m",
"torqueRange": string,
"batteryModel": string,
"temperature": number,
"temperatureUnits": "F" | "C",
"location": string,
"stationNumber": string,
"operator": string,
"transducerSerialNumber": string,
"procedure": string,
"comments": string,
"clockwiseTorqueTolerance": number,
"counterclockwiseTorqueTolerance": number,
"clockwiseTorque": {
"[torque]": [{ "asFound": number, "asLeft": number }]
},
"counterclockwiseTorque": {
"[torque]": [{ "asFound": number, "asLeft": number }]
}
}

Example State Definition

"Generate Laser Calibration Report": {
"Type": "Task",
"Resource": "Report:Generate",
"Parameters": {
"ReportType": "LaserCalibration",
"ReportDetails": {
"excludeVerticalAccuracySpecs": true,
"calibrationDate.$": "$.ExecutionStartTime"
},
"Service": {
"technicianName.$": "$.UserEmail"
},
"Tool": {
"serialNumber.$": "$.ToolRecord.serialNumber",
"description.$": "$.ToolRecord.description",
"modelNumber.$": "$.ToolRecord.model"
},
"Filename.$": "States.Format('LaserCalibration_{}.pdf', $.ToolRecord.serialNumber)"
},
"End": true
}

User Interface

UI:Display

Each interpreter may implement the behavior of UI tasks differently. But generally speaking, should follow these guidelines.

A "Display" is a UI element that simply appears somewhere for the user to view the information.

Exactly where, how, and for how long the UI element is displayed is up to the interpreter based on the context of the workflow where the state machine is executing. The interpreter may also take into Sentiment when deciding how to display the UI element.

Input Parameters

  • Title: The title of the UI element.
  • Message: The message of the UI element.
  • Sentiment: (optional) The sentiment of the UI element.
  • AdditionalDetails: (optional) Additional details of the UI element.
  • IsOpenByDefault: (optional) Open the details section by default, if this is not defined the card will hide the details defined in AdditionalDetails
{
"Title": string,
"Message": string,
"Sentiment": "Neutral" | "Success" | "Failure" | "Warning" | undefined,
"AdditionalDetails": object | undefined,
"IsOpenByDefault": boolean | undefined
}

Result

{}

Example State Definition

"My UI Display State": {
"Type": "Task",
"Resource": "UI::Display",
"Parameters": {
"Title": "Note",
"Message": "You're doing a great job",
"Sentiment": "Positive"
},
"End": true
}

UI:Prompt

Each interpreter may implement the behavior of UI tasks differently. But generally speaking, should follow these guidelines.

A "Prompt" is a UI element that appears over the top of other all other content.

If no UserInputType is provided, the prompt should simply be dismissible. The interpreter should display the prompt and then immediately proceed to execute the remainder of the state machine.

If UserInputType is SimpleConfirmation, the prompt should present the user with a message and pause execution of the state machine until the user dismisses the modal.

If UserInputType is Confirmation, the interpreter should present the user with a message and pause execution of the state machine until the user provides a response, if the response is affirmative set the result to Yes.

If UserInputType is Text, the interpreter should present the user with a input text field and pause execution of the state machine until the user provides a response.

If UserInputType is MultipleChoice, the interpreter should present the user with the options defined in the UserInputMultipleChoiceOptions and pause execution of the state machine until the user provides a response.

It's recommended that the interpreter should always include a cancel/dismiss option and the response for this action should set to No.

If UserInputType is Schema, the interpreter should present the user with the options defined in the Schema and pause execution of the state machine until the user provides a response.

Schema MUST be valid JSON using the JSONForms syntax. In this case, the response will be an object consisting of the defined property names and their entered values.

Input Parameters

  • Title: The title of the UI element.
  • Message: The message of the UI element.
  • Sentiment: (optional) The sentiment of the UI element.
  • UserInputType: (optional) The type of user input to be collected.
  • UserInputMultipleChoiceOptions: (optional) The options to be presented to the user if UserInputType is MultipleChoice.
  • Schema: (optional) The definition of the form to be presented to the user if the UserInputType is Schema, written using JSONForms.
{
"Title": string,
"Message": string,
"Sentiment": "Neutral" | "Success" | "Failure" | "Warning" | undefined,
"UserInputType": "Confirmation" | "SimpleConfirmation" | "Text" | "MultipleChoice" | undefined,
"UserInputMultipleChoiceOptions": string[] | undefined
"Schema": object | undefined
}

Result

{
"Response": string | object
}

Example State Definition - Basic Prompt

"My UI Prompt State": {
"Type": "Task",
"Resource": "UI:Prompt",
"Parameters": {
"Title": "M18 HO HD12.0 Battery Alert",
"Message": "<div style='font-weight: bold;'>If the battery is both:</div> <div style='margin-bottom: 20px;'><ul style='list-style-type: disc; margin-left: 20px;'><li><span style='text-decoration: underline;'>OUT OF WARRANTY DATE</span> (Up to 5 years past mfg date)</li><li><span style='text-decoration: underline;'>UNBALANCED</span></li></ul></div><div style='font-weight: bold;'>Then:</div><div><ul style='list-style-type: disc; margin-left: 20px;'><li>Replace battery on goodwill (code ROG)</li></ul></div>",
"Sentiment": "Success"
},
"End": true
}

Example State Definition - Multiple Choice

"My UI Prompt State": {
"Type": "Task",
"Resource": "UI:Prompt",
"Parameters": {
"Title": "Survey",
"Message": "How much do you love Milwaukee Tool?",
"Sentiment": "Neutral",
"UserInputType": "MultipleChoice",
"UserInputMultipleChoiceOptions": [ "A lot", "Tons", "Bucket loads", "Infinite" ]
},
"End": true
}

Example State Definition - Confirmation

"My UI Prompt State": {
"Type": "Task",
"Resource": "UI:Prompt",
"Parameters": {
"Title": "Prompt",
"Message": "Would you like to continue?",
"UserInputType": "Confirmation"
},
"Next": "Show Response"
},
"Show Response": {
"Type": "Task",
"Resource": "UI:Display",
"Parameters": {
"Title": "Response (ie. Yes or No)",
"Message.$": "States.Format('{}', $.Response)",
"Sentiment": "Neutral"
},
"End": true
}

Example State Definition - Text

"My UI Prompt State": {
"Type": "Task",
"Resource": "UI:Prompt",
"Parameters": {
"Title": "Prompt",
"Message": "What is your name?",
"UserInputType": "Text"
},
"Next": "Show Response"
},
"Show Response": {
"Type": "Task",
"Resource": "UI:Display",
"Parameters": {
"Title": "You entered:",
"Message.$": "States.Format('{}', $.Response)",
"Sentiment": "Neutral"
},
"End": true
}

Example State Definition - Schema

Note that Schema only supports a subset of the JSON schema features. Specifically types string, number, boolean, and object. Also supports required fields, enum lists, description (ie. help) text, and default values.

"My UI Prompt State": {
"Type": "Task",
"Resource": "UI:Prompt",
"Parameters": {
"Title": "Survey",
"Message": "Please fill in the following form:",
"Sentiment": "Neutral",
"UserInputType": "Schema",
"Schema": {
"type": "object",
"properties": {
"Name": {
"type": "string",
"minLength": 3,
"description": "Please enter your name"
},
"Vegetarian": {
"type": "boolean"
},
"Nationality": {
"type": "string",
"enum": [
"DE",
"IT",
"JP",
"US",
"RU",
"Other"
]
},
"Occupation": {
"type": "string",
"default": "Software Developer"
},
"PostalCode": {
"type": "number"
}
},
"required": [
"Name",
"Nationality",
"Occupation"
]
}
},
"End": true
}

UI:Notification

Each interpreter may implement the behavior of UI tasks differently. But generally speaking, should follow these guidelines.

A "Notification" is a UI element that simply appears somewhere for the user to let them know that something happened either success/failure.

Exactly where, how, and for how long the UI element is displayed is up to the interpreter based on the context of the workflow where the state machine is executing. The interpreter may also take into consideration Sentiment when deciding how to display the UI element.

Input Parameters

  • Message: The message of the UI element.
  • Sentiment: (optional) The sentiment of the UI element.
{
"Message": string,
"Sentiment": "Neutral" | "Success" | "Failure",
"Dismissible": boolean | undefined
}

Result

{}

Example State Definition

"My UI Notification State": {
"Type": "Task",
"Resource": "UI:Notification",
"Parameters": {
"Message": "You're doing a great job",
"Sentiment": "Success"
},
"End": true
}

Calculations

Calculation:CellBalance

This task will take an array of cell voltages and determine if the pack is balanced. If the pack is balanced, the task will return Yes for IsBalanced and the min/max cell voltages and all cell voltages. If the pack is not balanced, the task will return No for IsBalanced and the min/max cell voltages and all cell voltages.

Input Parameters

  • Value: The array of cell voltages.
  • ComparatorValue: The value to compare against.
  • IsLittleEndian: Whether the array is little endian or not.
{
"Value": number[] | undefined,
"ComparatorValue": number,
"IsLittleEndian": boolean
}

Result

{
"IsBalanced": 'Yes' | 'No',
"MinCell": number, // e.g. 3200
"MaxCell": number, // e.g. 3500
"AllCells": string // e.g. 3299,3300,3298,3297
}

Example State Definition

"My Parse Cell Balance": {
"Type": "Task",
"Resource": "Calculation:CellBalance",
"Parameters": {
"Value": [0, 1, 2, 3, 4],
"ComparatorValue": 30,
"IsLittleEndian": false
},
"End": true
}

MXCharge:ParseDatalogger

Input Parameters are for this resource are the data read from the datalogger and the current power cycle number, this resource is used to parse the datalogger for the MX Super Charger.

Input Parameters

  • Data: The array of data read from the datalogger.
  • PowerCycle: The current power cycle number.
{
"Data": number[],
"PowerCycle": number
}

Result

{
"Result": "Success" | "Failed",
"Errors": string[]
}
{
"DataloggerData.$": [0,0,0,0...........,0],
"PowerCycleCount": 10
}

Example State Definition

"Show Context": {
"Type": "Task",
"Resource": "MXCharger:ParseDatalogger",
"Parameters": {
"Data.$": "$.DataloggerData",
"PowerCycle.$": "$.PowerCycleCount"
},
"End": true
}

Debug

Debug:DebugConsole

Input Parameters

  • None

When executed, this resource will print the current global context object to the browsers console window.

This is useful for understanding what is being passed between states.

Example State Definition

"Show Context": {
"Type": "Task",
"Resource": "Debug:DebugConsole",
"End": true
}

Debug:DumpLog

Input Parameters

  • None

When executed, this resource will construct and download a .csv file. The file will contain all communication logs since the beginning of the state machine execution.

Example State Definition

"Dump Log": {
"Type": "Task",
"Resource": "Debug:DumpLog",
"End": true
}

Cache

The following resources allow an MTSL script to store and retrieve data locally.

The QuickLink Web MTSL interpreter stores cache information in the browser's Local Storage.

Cache:Save

Input Parameters

  • Key: The key to store the data under.
  • Value: The data to store.
{
"Key": string,
"Value": string | object
}

Result

{}

Example State Definition

"Save to Cache": {
"Type": "Task",
"Resource": "Cache:Save",
"Parameters": {
"Key": "SomeKey",
"Value": "123456789ABC"
},
"End": true
}

Cache:Load

Input Parameters

  • Key: The key to retrieve the data from.
{
"Key": string
}

Result

{
"Result": string or object retrieved from store
}

Example State Definition

"Load from Cache": {
"Type": "Task",
"Resource": "Cache:Load",
"Parameters": {
"Key": "SomeKey"
},
"End": true
}

Return

{
"Result": "123456789ABC"
}

Cache:Clear

Input Parameters

  • Key: The key to clear from the cache.
{
"Key": string
}

Result

{}

Example State Definition

"Clear Cache": {
"Type": "Task",
"Resource": "Cache:Clear",
"Parameters": {
"Key": "SomeKey"
},
"End": true
}

User

The following resources allow an MTSL script to retrieve information about the user currently signed in.

These resources assume that the Interpreter requires authentication and uses JWT tokens.

User:GetInfo

Input Parameters

  • None

Result

{
"email": string,
"roles": string[],
"region": "NA" | "EMEA" | "ANZ"
}

Example State Definition

"Get User Info": {
"Type": "Task",
"Resource": "User:GetInfo",
"ResultPath": "$.UserInfo",
"Next": "XYZ"
}

The following resources are QuickLink specific.

QuickLink:FirmwareUpdate

Updates the attached device's firmware from Artifactory. This task has two modes of operation:

  • Without Version (prompt mode): Dispatches a check for newer firmware and returns success immediately. The app UI handles the actual prompt and update flow. Only production releases are considered when deciding whether a newer version exists, regardless of the Production parameter.
  • With Version (specific-version mode): Flashes the exact specified version without prompting and waits for completion. The task fails if flashing does not start within 30 seconds or does not complete within 10 minutes.

Input Parameters

  • Version: (optional) The exact firmware version to install from Artifactory. When omitted, the task enters prompt mode (see above). When specified, the task enters specific-version mode and waits for the flash to complete.
  • Production: (optional) Controls which Artifactory releases are searched when Version is specified. If true, only production releases are searched. If false (default), all releases including non-production are searched. This parameter has no effect in prompt mode; only production releases are checked regardless of its value.
  • ToolData: (optional) A full tool record (ToolRecord). Supplies the tool identity and credentials used for the update instead of the currently connected tool's record. Its most important field is metcoPassword, used to authenticate to the tool before reading firmware info and flashing; the record also drives selection of the correct Artifactory artifacts. When omitted, the connected tool's record is used; if that record has no METCO password, the default METCO password is applied. Applies to both prompt mode and specific-version mode.
{
"Version": string | undefined,
"Production": boolean | undefined,
"ToolData": ToolRecord | undefined
}

ToolRecord

ToolData accepts a tool record object in the same shape as $.ToolRecord in script context. Only mpbid is required; all other fields are optional. For firmware updates, metcoPassword is the most important field — it is used to authenticate to the tool before reading firmware info and flashing.

{
"mpbid": "0114000123",
"serialNumber": "G1234-56789",
"model": "2825-20",
"description": "M18 FUEL Compact Router",
"firmwareVersion": "2.1.0.2",
"metcoPassword": "1234123412341234",
"servicePassword": "399A1A341CA9D0AB",
"platform": "M18",
"region": "NA"
}

Result

When Version is specified:

{
"Result": "Success",
"Version": string
}

When Version is not specified, no result is returned (original behavior).

Example State Definition - Check for Updates (Original Behavior)

"Check for Firmware Updates": {
"Type": "Task",
"Resource": "QuickLink:FirmwareUpdate",
"End": true
}

Example State Definition - Update to Specific Version

"Update to Specific Version": {
"Type": "Task",
"Resource": "QuickLink:FirmwareUpdate",
"Parameters": {
"Version": "2.1.0.3"
},
"Next": "Continue After Update"
}

Example State Definition - Update to Specific Production Version

"Update to Production Version": {
"Type": "Task",
"Resource": "QuickLink:FirmwareUpdate",
"Parameters": {
"Version": "2.1.0.3",
"Production": true
},
"Next": "Continue After Update"
}

Example State Definition - Update Using an Explicit Tool Record

Use ToolData when the script has a tool record in context (for example, from a prior API call or lookup) and you want the update to use that record's credentials and identity instead of the connected tool's record.

"Update Firmware For Tool Record": {
"Type": "Task",
"Resource": "QuickLink:FirmwareUpdate",
"Parameters": {
"Version": "2.1.0.3",
"ToolData.$": "$.ToolRecord"
},
"Next": "Continue After Update"
}

Note: If the specified version is not found in Artifactory, the task will fail with an error message listing the available versions.

QuickLink:BleFirmwareUpdate

When running a Rework script, this will show a prompt to the user to update the attached device's BLE firmware if there is a newer version with a release type of production available in Artifactory.

Input Parameters

None

Example State Definition

"Update Firmware": {
"Type": "Task",
"Resource": "QuickLink:BleFirmwareUpdate",
"End": true
}

QuickLink:MemoryMapDataRead

This Task is used to read data from a tool using the memory map. It uses the version of the tool's memory map that is stored on the tool. By default it uploads the data to the cloud in the same manner as when a tool data read is performed in the QuickLink app.

Note that for most tools, the METCO password must be sent to the tool prior to reading the memory map.

Also note that it does not support multi MCU tools.

For more information on memory maps, see the Tool Memory Maps documentation.

Input Parameters

  • SVCode: (optional) The SV code to associate with the data read.
  • ServicePassword: (optional) The service password for the tool, only required for CANopen tools like the Roll On.
  • SkipUpload: (optional) If set to true, the data will not be uploaded to the cloud, but will still be available to the script.
{
"SVCode": string | undefined,
"ServicePassword": string | undefined,
"SkipUpload": boolean | undefined
}

Example State Definition

"Do Data Read": {
"Type": "Task",
"Resource": "QuickLink:MemoryMapDataRead",
"Parameters": {
"SVCode": "1234567",
"ServicePassword": "399A1A341CA9D0AB",
"SkipUpload": false
},
"Next": "Show Results"
}

Return

Results are outputted as an object with the values keyed by the memory map addresses read from the tool.

{
"9000": "003C001F",
"9004": "0035000000000000000000000000000000000000000000000000000000000000",
"9024": "0000000000000000000000000000000000000000000000000000000000000000",
"9044": "0000000000000000000000000000000000000000000000000000000000000000",
"9064": "0000000000000000000000000000000000000000000000000000000000000000",
"9084": "0000000000000000000000000000000000000000000000000000000000000000",
"9104": "0000000000000000000000000000000000000000000000000000000000000000",
"9124": "0000000000000000000000000000000000000000000000000000000000000000",
"9144": "0000000000000000000000000000000000000000000000000000000000000000",
"9164": "0000000000000000000000000000000000000000000000000000000000000000",
"9184": "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0000": "0003",
"0002": "0000",
"0004": "00C0014F9F",
"0009": "35866CCF",
"000D": "02010012",
"0011": "5F846BE4",
"001D": "000000000000",
"0023": "556E646566696E65642D2D2D2D2D2D2D2D2D2D2D",
"0037": "66D9BCE7",
"0063": "BC33ACB8842A",
"0069": "0002",
"007B": "01",
"90A4": "0000000000000000000000000000000000000000000000000000000000000000",
"90C4": "0000000000000000000000000000000000000000000000000000000000000000",
"90E4": "0000000000000000000000000000000000000000000000000000000000000000",
"91B0": "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"91DC": "00000000000000000000000000000000000000000000",
"91F2": "00000000",
"91F6": "00000000",
"91FA": "00000000"
}

This allows the values to be accessed by address like:

{
"Message.$": "State.Format('Value at Address 9000: {0}', $.9000)"
}